package entity;
// default package

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Newstypes entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "newstypes", catalog = "house")
public class Newstypes implements java.io.Serializable {

	// Fields

	private Integer id;
	private String NName;
	private Integer tid;
	private Set<News> newses = new HashSet<News>(0);

	// Constructors

	/** default constructor */
	public Newstypes() {
	}

	/** minimal constructor */
	public Newstypes(String NName) {
		this.NName = NName;
	}

	/** full constructor */
	public Newstypes(String NName, Set<News> newses) {
		this.NName = NName;
		this.newses = newses;
	}

	// Property accessors
	@Id
	@GeneratedValue
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "n_name", nullable = false, length = 20)
	public String getNName() {
		return this.NName;
	}

	public void setNName(String NName) {
		this.NName = NName;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "newstypes")
	public Set<News> getNewses() {
		return this.newses;
	}

	public void setNewses(Set<News> newses) {
		this.newses = newses;
	}

	public Integer getTid() {
		return tid;
	}

	public void setTid(Integer tid) {
		this.tid = tid;
	}

}